//
//  ZDUser.m
//  特种车调度
//
//  Created by 陈宇 on 15/8/21.
//
//

#import "ZDUser.h"

@implementation ZDUser

+ (NSDictionary *)replacedKeyFromPropertyName
{
    return @{@"ID": @"id"};
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super init]) {
        _ID = [aDecoder decodeIntegerForKey:@"id"];
        _name = [aDecoder decodeObjectForKey:@"name"];
        _uid = [aDecoder decodeIntegerForKey:@"uid"];
        _phone = [aDecoder decodeObjectForKey:@"phone"];
        _icon = [aDecoder decodeObjectForKey:@"icon"];
        _address = [aDecoder decodeObjectForKey:@"address"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    if (_ID) {
        [aCoder encodeInteger:_ID forKey:@"id"];
    }
    if (_uid) {
        [aCoder encodeInteger:_uid forKey:@"uid"];
    }
    if (_name) {
        [aCoder encodeObject:_name forKey:@"name"];
    }
    if (_phone) {
        [aCoder encodeObject:_phone forKey:@"phone"];
    }
    if (_icon) {
        [aCoder encodeObject:_icon forKey:@"icon"];
    }
    if (_address) {
        [aCoder encodeObject:_address forKey:@"address"];
    }
}

@end
